﻿@model ScrumProject.ViewModels.ResetPasswordViewModel

@{
    ViewBag.Title = "Change password";
}

<h2>Change password</h2>

@if (Model == null)
{
    <p>
        We could not find your user account in the database.
    </p>
}
else
{

   <p>
   <h4>Please enter your new password below.</h4>
   </p>
     <p>
        Note: New passwords are required to be a minimum of 5 characters in length.
    </p>

    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $().ready(function() {
            $("#adminForm").validate({
                rules: {
                    Password: {
                        minlength: 5
                    },
                    ConfirmPassword: {
                        minlength: 5,
                        equalTo: "#Password"
                    },
                },
                messages: {
                    password: {
                        minlength: "Your password must be at least 5 characters long"
                    },
                    confirm_password: {
                        minlength: "Your password must be at least 5 characters long",
                        equalTo: "Please enter the same password as above"
                    },
                }
            });
        });
    </script>

    using (Html.BeginForm())
    {
    <div style="position: relative;">
   
   <table class="table">
    <thead></thead>
    <tbody>
        <tr>
            <td>
                New Password
            </td>
            <td>
                @Html.PasswordFor(m => m.NewPassword)
            </td>
            <td>
                @Html.ValidationMessageFor(m => m.NewPassword)
            </td>
        </tr>
          <tr>
            <td>
                Confirm New Password
            </td>
            <td>
                @Html.PasswordFor(m => m.ConfirmPassword)
            </td>
            <td>
                @Html.ValidationMessageFor(m => m.ConfirmPassword)
            </td>
         </tr>
    </tbody>
    </table> 
     <p>
                <input type="submit" value="change Password" class="btn" />
            </p>
            @*
     <fieldset>
        <label for="NewPassword" style="position:absolute; top: 24px; left: 16px;">New Password</label>
           <div class="editor-field">
                @Html.PasswordFor(m => m.NewPassword)
                @Html.ValidationMessageFor(m => m.NewPassword)
            </div>
            <br />
        <label for="ConfirmPassword" style="position:absolute; top: 64px; left: 16px;">Confirm New Password</label>     


            <div class="editor-field">
                @Html.PasswordFor(m => m.ConfirmPassword)
                @Html.ValidationMessageFor(m => m.ConfirmPassword)
            </div> 
      </fieldset> *@

    </div>
    }
}

@* STARO
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <table class="table">
    <thead></thead>
    <tbody>
          <tr>
            <td>
                @Html.LabelFor(model => model.Password)
            </td>
            <td>
                @Html.EditorFor(EmptyResult)
            </td>
            <td>
                @Html.ValidationMessageFor(model => model.Password)
            </td>
        </tr>
        <tr>
            <td>
               @Html.HiddenFor(model => model.Id)
            </td>
            <td>
               <input type="submit" value="Save" class="btn" />
            </td>
            <td>
            </td>
        </tr>
    </tbody>
    </table>
}*@
<div>
    <input type="button" value="Back" onclick="history.go(-1)" class="btn" />
</div>
